package com.cade.agriculturemall;

import android.app.Application;

import com.avos.avoscloud.AVOSCloud;
import com.avos.avoscloud.AVObject;
import com.avos.avoscloud.AVUser;
import com.cade.agriculturemall.model.AddressEntity;
import com.cade.agriculturemall.model.GoodsDetailEntity;
import com.cade.agriculturemall.model.GoodsItemEntity;
import com.cade.agriculturemall.model.ItemFavouriteEntity;
import com.cade.agriculturemall.model.ItemModelOfDrawerListEntity;
import com.cade.agriculturemall.model.OrderEntity;
import com.cade.agriculturemall.model.ShoppingCarsEntity;
import com.cade.agriculturemall.model.Ticket;
import com.cade.agriculturemall.model.UserInfoEntity;

/**
 * Created by Lobby on 2017/11/14.
 */

public class App extends Application{
    private static App sInstance;
    @Override
    public void onCreate() {
        super.onCreate();
        sInstance = this;
        AVObject.registerSubclass(Ticket.class);
        AVObject.registerSubclass(OrderEntity.class);
        AVObject.registerSubclass(AddressEntity.class);
        AVObject.registerSubclass(ShoppingCarsEntity.class);
        AVObject.registerSubclass(ItemFavouriteEntity.class);
        AVObject.registerSubclass(GoodsItemEntity.class);
        AVObject.registerSubclass(GoodsDetailEntity.class);
        AVUser.registerSubclass(UserInfoEntity.class);
        AVObject.registerSubclass(ItemModelOfDrawerListEntity.class);
        // 初始化参数依次为 this, AppId, AppKey
        AVOSCloud.initialize(this,"eFnCRaEfmMIkgTu2kiFgp0Cj-gzGzoHsz","TpP5Bc7RSd87kkHCz9x3nqJf");
        AVOSCloud.setDebugLogEnabled(true);


    }

    public static App getInstance() {
        return sInstance;
    }
}
